package com.wyfan.scaffold.test;

import java.util.concurrent.CountDownLatch;

public class Main {

    public static void main(String[] args) throws InterruptedException {
        cal();
        Thread.sleep(10000);
        cal();
    }

    private static void cal() throws InterruptedException {
        CountDownLatch latch = new CountDownLatch(CalTaskAbstract.TASK_COUNT.get());
        CalPool.submit(new Task1(latch,true,1));
        CalPool.submit(new Task2(latch,true,3));
        CalPool.submit(new Task3(latch,true,2));
        latch.await();
        System.out.println("计算完毕");
    }

}
